package org.megha.blog.example.part4;

import org.megha.blog.example.part2.Circle;
import org.megha.blog.example.part3.Person;

/**
 * A printer that can print a {@link Circle} or a {@link Person} or both.
 */
public class Printer {

	public void print(Circle circle) {
		System.out.println("printing circle...");
		circle.print();
	}

	public void print(Person person) {
		System.out.println("printing person...");
		person.print();
	}

	public void print(Circle circle, Person person) {
		System.out.println("printing circle and person");
		person.print();
		circle.print();
	}

	public void print(Person person, Circle circle) {
		System.out.println("printing person and circle");
		person.print();
		circle.print();
	}

	public static void main(String args[]) {

		Printer printer = new Printer();

		Circle circle1 = new Circle(8);
		Person person1 = new Person("Samuel", "Engineer");

		printer.print(circle1);
		printer.print(person1);
		printer.print(circle1, person1);
		printer.print(person1, circle1);
	}
}
